#include <stdio.h>
#include "array_queue.h"

#define N 10

int main()
{
    aqueue_t *queue = NULL;
    int ret, tmp;

    ret = aqueue_init(&queue, N, sizeof(int));
    if (ret != 0) {
        printf("初始化失败\n");
        return -1;
    }

    printf("is empty：%d\n", aqueue_empty(queue));

    for (ret = 1; ret <= N; ret++)
        aqueue_push(queue, &ret);
    
    printf("is empty：%d\n", aqueue_empty(queue));
    printf("cap %d\n", queue->capacity);

    while (!aqueue_empty(queue)) {
        aqueue_pop(queue, &tmp);
        printf("%d ", tmp);
    }
    printf("\n");

    aqueue_destroy(&queue);

    return 0;
}
